# # # >>> l1 = [10, 8, 20, 10, 35, 2]
# # # >>> l1[0] = 20
# # # >>> l1[1:3] = [10, 20, 30, 40]
# # # >>> l1
# # # [20, 10, 20, 30, 40, 10, 35, 2]
# # # >>> l1[1:1]
# # # []
# # # >>> l1[1:1] = [100, 200]
# # # >>> l1
# # # [20, 100, 200, 10, 20, 30, 40, 10, 35, 2]
# # # >>> l2 = [10, 20, 30, 40, 50]
# # # >>> l2[0]
# # # 10
# # # >>> l2[1:3] = [200, 300]
# # # >>> l2
# # # [10, 200, 300, 40, 50]
# # # >>> l2
# # # [10, 200, 300, 40, 50]
# # # >>> l2[1:1]
# # # []
# # # >>> l2[1:1] = [1000, 2000]
# # # >>> l2
# # # [10, 1000, 2000, 200, 300, 40, 50]
# # # l1.append()     在尾部追加>>> l1.append([1, 2,3])
# # # >>> l1
# # # [20, 100, 20, 200, 10, 20, 30, 40, 10, 35, 2, [1, 2, 3], [1, 2, 3], [1, 2, 3]]
# # # >>> l1.extend([1,2,3])
# # # >>> l1
# # # [20, 100, 20, 200, 10, 20, 30, 40, 10, 35, 2, [1, 2, 3], [1, 2, 3], [1, 2, 3], 1, 2, 3]
# # # >>> l1.insert(2,20)
# # # l1.append([1,2,3])  #尾部整体加
# # # l1.extend([1,2,3])  #尾部分别加
# # # l1.insert(2,20)     #向下标2的位置车如20
# # # >>> l4
# # # [1, 2, 3, 4, 5, 6, [10, 20, 30], 100, 200, 300]
# # # >>> l4.remove(100)   #删除左侧第一项
# # # >>> l4
# # # [1, 2, 3, 4, 5, 6, [10, 20, 30], 200, 300]
# # # >>> l4.pop()      #弹出默认最后一项
# # # 300
# # # >>> b = l4.pop()  #弹出赋值赋值，不回显
# # # >>> b
# # # 200
# # # >>> l4.pop(-2)    #弹出制定下标
# # # 6
# # # >>> l4
# # # [1, 2, 3, 4, 5, [10, 20, 30]]
# # # >>> l4.index(5)
# # # 4
# # # >>> s1.index(2000)
# # # 2
# # # >>> s1.index(1,1)
# # # 12
# # # >>> s1 = [1,2,3,4,5,6,7,8]
# # # >>> s1
# # # [1, 2, 3, 4, 5, 6, 7, 8]
# # # >>> s1[0]
# # # 1
# # # >>> s1[1:3] = [20, 30]
# # # >>> s1
# # # [1, 20, 30, 4, 5, 6, 7, 8]
# # # >>> s1[1:1] = [200, 2000]
# # # >>> s1
# # # [1, 200, 2000, 20, 30, 4, 5, 6, 7, 8]
# # # >>> s1.append([1,2,3])
# # # >>> s1
# # # [1, 200, 2000, 20, 30, 4, 5, 6, 7, 8, [1, 2, 3]]
# # # >>> s1.extend([1,2,3])
# # # >>> s1
# # # [1, 200, 2000, 20, 30, 4, 5, 6, 7, 8, [1, 2, 3], 1, 2, 3]
# # #
# # # 数据分类 存储类型  更新类型   访问类型
# # # 数字     标量      不可变     直接
# # # 字符串   标量       不可变    顺序
# # # 列表     容器       可变     顺序
# # # 元组     容器       不可变    顺序
# # # 字典     容器       可变      映射
# # # print('\033[35;1m%s %s %s %s\033[0m' %  ('数据分类', '存储类型',  '更新类型','访问类型'),end='\t\t')
# # # print()
# # # print('\033[32;1m%s %s %s %s\033[0m' %  ('数字    ', '标量   ',  '不可变  ','直接'),end='\t\t')
# # # print()
# # # print('\033[32;1m%s %s %s %s\033[0m' %  ('字符串  ',  '标量   ',  '不可变  ','顺序'),end='\t\t')
# # # print()
# # # print('\033[34;1m%s %s %s %s\033[0m' %  ('列表    ',  '容器   ',  '可变    ', '顺序'),end='\t')
# # # print()
# # # print('\033[32;1m%s %s %s %s\033[0m' %  ('元组    ',  '容器   ', '不可变  ', '顺序'),end='\t')
# # # print()
# # # print('\033[34;1m%s %s %s %s\033[0m' %  ('字典    ',  '容器   ',  '可变    ', '映射'),end='\t')
# # # print('\033[35;1m%s %s %s %s\033[0m' %  ('数据分类', '存储类型',  '更新类型','访问类型'),end='\t\t')
# # # print()
# # # print('\033[32;1m%s %s %s %s\033[0m' %  ('数字    ', '标量   ',  '不可变  ','直接'),end='')
# # # print()
# # # print('\033[32;1m%s %s %s %s\033[0m' %  ('字符串  ',  '标量   ',  '不可变  ','顺序'),end='\t\t')
# # # print()
# # # print('\033[34;1m%s %s %s %s\033[0m' %  ('列表    ',  '容器   ',  '可变    ', '顺序'),end='\t')
# # # print()
# # # print('\033[32;1m%s %s %s %s\033[0m' %  ('元组    ',  '容器   ', '不可变  ', '顺序'),end='\t')
# # # print()
# # # print('\033[34;1m%s %s %s %s\033[0m' %  ('字典    ',  '容器   ',  '可变    ', '映射'),end='\t')
# #
# #
# # option = '''('\033[35;1m%s %s %s %s\033[0m' %  ('数据分类', '存储类型',  '更新类型','访问类型'),end='\t\t')
# # ('\033[32;1m%s %s %s %s\033[0m' %  ('数字    ', '标量   ',  '不可变  ','直接'),end='')
# # '\033[32;1m%s %s %s %s\033[0m' %  ('字符串  ',  '标量   ',  '不可变  ','顺序'),end='\t\t'
# # '\033[32;1m%s %s %s %s\033[0m' %  ('字符串  ',  '标量   ',  '不可变  ','顺序'),end='\t\t'
# # '\033[32;1m%s %s %s %s\033[0m' %  ('元组    ',  '容器   ', '不可变  ', '顺序'),end='\t'
# # '\033[34;1m%s %s %s %s\033[0m' %  ('字典    ',  '容器   ',  '可变    ', '映射'),end='\t'
# # '''
# d1 = {'name': 'tom', 'age': '20', 'sex': 'girl'}
# >>> d2 =dict([('name','tom'),('sex','boy'),('age','23')])
# >>> d2
# {'name': 'tom', 'sex': 'boy', 'age': '23'}
# >>> d3 = {}.fromkeys(['tom','jerry','cjj',],20)
# >>> d3
# {'tom': 20, 'jerry': 20, 'cjj': 20}
# {'name': 'tom', 'sex': 'boy', 'age': 25, 'phon': 134}
# >>> len(d2)
# 4
# >>> d2['name']  = jerry
# Traceback (most recent call last):
#   File "<stdin>", line 1, in <module>
# NameError: name 'jerry' is not defined
# >>> d2['name']  = 'jerry'
# >>> d2
# {'name': 'jerry', 'sex': 'boy', 'age': 25, 'phon': 134}
# >>> d2['name']  = 'je'
# >>> d2
# {'name': 'je', 'sex': 'boy', 'age': 25, 'phon': 134}
# >>> s2 & s3 & s4
# {'b', 'c'}
# >>> s2 | s3 | s4
# {'c', 'a', 'd', 'b', 'e'}
#>>> from random import randint
>>> nums = [randint(1,50) for i in range(20)]
>>> nums
[8, 12, 20, 38, 41, 49, 8, 21, 12, 18, 33, 43, 26, 43, 43, 12, 14, 25, 23, 47]
>>> nums = list(set(nums))
>>> nums
[33, 38, 8, 41, 43, 12, 14, 47, 49, 18, 20, 21, 23, 25, 26]
process stack
process stack